package com.hopu.springbootdemo2.exception;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 * 处理全局异常
 */
@ControllerAdvice
public class MyExceptionHandler{

    /**
     * 处理用户解析异常
     * @return
     */
    @ExceptionHandler(UserTokenException.class)
    public ResponseEntity<String> handleUserTokenException(){
        return ResponseEntity.ok("not login");
    }
}
